<li class='clearfix record icons' id="<%= dom_id(gallery) -%>">
  <div class='clearfix'>
    <span class="icon" %></span>

    <span class='title'>
      <%= gallery.title %>
      <span class="preview">
        <% if defined?(::Refinery::I18n) and ::Refinery::I18n.frontend_locales.many? and
              (locales = gallery.translations.collect{|t| t.locale}).present? %>
          <% locales.each do |locale| %>
            <%= refinery_icon_tag "flags/#{locale}.png", :size => '16x11' %>
          <% end %>
        <% end %>
    </span>

    <span class='actions'>
      <%= link_to refinery_icon_tag("application_edit.png"), refinery.edit_portfolio_admin_gallery_path(gallery),
           :title => t('.edit') %>

      <%= link_to refinery_icon_tag("delete.png"), refinery.portfolio_admin_gallery_path(gallery),
          :class => "cancel confirm-delete",
          :title => t('.delete'),
          :confirm => t('message', :scope => 'refinery.admin.delete', :title => gallery.title),
          :method => :delete %>

      <%= link_to t('.item_count', :count => gallery.items.count), refinery.portfolio_admin_gallery_items_path(gallery), :rel => 'items' %>
    </span>
  </div>
  <ul class='nested' data-ajax-content="<%= refinery.children_portfolio_admin_gallery_path(gallery.id) %>">
    <%= render(:partial => 'gallery', :collection => gallery.children) %>
  </ul>
</li>
